<template>
  <div class="radio-group">
    <div v-for="option in options" :key="option.value">
      <input type="radio" :id="option.value" :value="option.value" v-model="selected">
      <label :for="option.value">{{option.label}}</label>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    options: {
      type: Array,
      required: true,
    },
    value: {
      type: String,
      required: true,
    },
  },
  computed: {
    selected: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit('input', val);
      },
    },
  },
};
</script>